<!--{template "topic_header"}-->

<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][event][header]}-->
<!--{eval SetADV('event','header');}-->
<!--{/if}-->

<div class="main">
	<div class="mainWrap">
		<div class="listBox">
			<div class="eventInfo">
				<div class="e_list_title">
					{$rs['title']}
					<!--{if $from['name']}-->
					(来自<a href="{$from['url']}" target='_blank'>$from['name']</a>)
					<!--{/if}-->
				</div>
				<div class="e_list_box" style="margin-bottom: 30px;">
					<div class="left_user_info">
						<div class="avatar_left">
							<a target="_blank" href="{$rs[image]}"> <img
								src="{$rs[image]}" height="110" width="110"></img>
							</a>
						</div>
						<div class="avatar2_info event_d avatar2_info_2"
							style="margin-right: 10px; border-right: 1px dashed #ccc;">
							<p class="left_t2">开始时间：{$rs['fromt']}（{$rs['fromt_day']}）</p>
							<p class="left_t2">报名截止时间：{$rs['deadLine']}（{$rs['deadLine_day']}）</p>
							<p class="left_t2">报名人数达到{$rs['minNum']}人可进行</p>
							<p class="left_t2">结束时间：{$rs['tot']}（{$rs['tot_day']}）</p>
							<p class="left_t2">地点：{$rs['address']}</p>
							<p class="left_t2">
								发起人：<a href="index.php?mod=$rs[username]" target="_blank">{$rs[nickname]}</a><a
									href="index.php?mod=event&code=myevent&uid=$rs['uid']"
									target="_blank">(查看他的活动)</a>
							</p>
							<p class="left_t2">费用：{$rs['money']}</p>
						</div>
						<div class="e_detail_sign">
							<p class="ri_t2">{$rs[app_num]}人报名</p>
							<p class="ri_t2">同意{$rs[play_num]}人 参与</p>
							<p id="event_type">
								<span>{$rs[event_type]}</span>
							</p>
							
							<!--{if $rs[status]==1}-->
							<p id="app">
								<!--{if $rs[app] == 1 || $rs[app]=='已报名'}-->
								<a href="javascript:void(0);"
									onclick="app('cancle');return false;">取消报名</a>
								<!--{else}-->
								<a href="javascript:void(0);" onclick="app('app');return false;">我要报名</a>
								<!--{/if}-->
							</p>
							<!--{/if}-->
							
							
							
						</div>

						<div class="event_eidt_box">
							<a href="javascript:void(0);" onclick="share();return false;"
								class="efx">分享</a>
							<!--{if !$rs[store]}-->
							<a href="javascript:void(0);"
								onclick="store('store');return false;" class="esc">收藏</a>
							<!--{else}-->
							<a href="javascript:void(0);"
								onclick="store('cancle');return false;" class="esc">取消收藏</a>
							<!--{/if}-->
							<!--{if MEMBER_ID == $rs[postman]}-->
							<a href="javascript:void(0);" onclick="manage(1);return false;"
								class="egl">管理</a> <a href="javascript:void(0);"
								onclick="window.location.href='index.php?mod=event&code=export_to_excel&id=$id';return false;"
								class="edc">导出</a>
							<!--{/if}-->
							<!--{if MEMBER_ID == $rs[postman]}-->
							<a href="index.php?mod=event&code=editevent&id=$rs[id]"
								class="exg">修改活动</a> <a
								href="index.php?mod=event&code=del&id=$rs[id]"
								onclick="return confirm('你确实要删除吗?不可恢复');" class="edel">删除活动</a>
							<!--{/if}-->
							<a href="index.php?mod=event&code=pic&id={$rs['id']}" class="efx" target="_blank">相册</a>
						</div>

					</div>
				</div>

				<div class="e_idS" style="overflow: visible">
					<div class="e_idSpTitle">
						<b>活动简介</b>
					</div>
					<div class="e_intro">{$rs[content]}</div>
				</div>
			</div>
			<div class="topic_new_add">
				<script language="javascript">
			__APPITEM__ = 'event';
			__APPITEM_ID__ = {$rs[id]};
		</script>
				<!--{template "topic_publish"}-->
			</div>
			<div id="listTopicArea"
				style="margin: 5px 0; width: 650px; float: left">{template
				"topic_list_ajax"}</div>
			<div id="share"></div>
			<div id="need_info"></div>
		</div>

		<script type="text/javascript">
	function listTopic() {
		var id = document.getElementById('hid_id').value;
		var myAjax = $.post(
			"ajax.php?mod=app&code=list_event&item_id="+id,
			function (d) {
				$("#listTopicArea").html(d);
			}
		); 
	}
	
	function share(t){
		var check_uid = $('#check_PublishBox_uid').val();
		var uid ='undefined'==typeof(check_uid)?'0':check_uid;	
		if(uid < 1){
			ShowLoginDialog();
			return false;
		}
		var handle_key = "share";
		$.post(
				"ajax.php?mod=event&code=publish_share&id=$id",
				function(d){
					showDialog(handle_key, 'local', '分享', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							if(t){
								location.reload();
							}else{
								closeDialog(handle_key);
							}
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										closeDialog(handle_key);
									}
								}
							publishSimpleTopic($('#topic_simple_content').val(), 'web', $("#topic_simple_item_id").val(),options);
							MessageBox('notice', '分享成功');
						}
					);
				}
		);
	}

	function simpleTalk(){
		var handle_key = "simpletalk";
		$.post(
				"ajax.php?mod=event&code=simple_talk&id=$id",
				function(d){
					showDialog(handle_key, 'local', '报名成功，说说你对该活动有什么看法？', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							location.reload();
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										location.reload();
									},
									topic_type:$('#topic_simple_type').val()
								}
							if(!$('#topic_simple_content').val()){MessageBox('notice', '请输入评论内容');return false;}
							publishSimpleTopic($('#topic_simple_content').val(), 'event', $("#topic_simple_item_id").val(),options);
						}
					);
				}
		);
	}

	function store(t){
		var check_uid = $('#check_PublishBox_uid').val();
		var uid ='undefined'==typeof(check_uid)?'0':check_uid;	
		if(uid < 1){
			ShowLoginDialog();
			return false;
		}
		$.post("ajax.php?mod=event&code=store&id=$id&type="+t,
				function(d){
			location.reload();
			}
		);
	}

	function app(t){
		var check_uid = $('#check_PublishBox_uid').val();
		var uid ='undefined'==typeof(check_uid)?'0':check_uid;	
		if(uid < 1){
			ShowLoginDialog();
			return false;
		}
		var myAjax=$.post(
				"ajax.php?mod=event&code=app&id=$id&type="+t,
				function(d){
					if(!is_json(d)){
						var handle_key = 'need_info';
						showDialog(handle_key, 'ajax', '我要参加', {url:"ajax.php?mod=event&code=app&id=$id&type="+t}, 300);
					}else{
						var json = eval('('+d.toString()+')');
						if(json.done){
							if(json.msg == '1'){
								simpleTalk();
							}else{
								MessageBox('notice', json.msg);
								setTimeout('location.reload()',1000);
							}
						}else{
							MessageBox('warning', json.msg);
						}
					}
				}
		);
	}

	function manage(page){
		handle_key = "manage";
		showDialog(handle_key, 'ajax', '我要参加', {url:"ajax.php?mod=event&code=manage&id=$id&page="+page}, 600);
	}
	</script>
	</div>

	<!--右侧--begin-->
	<div class="mainSide">

		<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][event][middle_right_top]}-->
		<!--{eval SetADV('event','middle_right_top');}-->
		<!--{/if}-->

		{template "topic_right_ajax.inc"}
		<div class="side">
			<ul class="event_r_nav">
				<li><a href="index.php?mod=event"><span>活动主页</span></a></li>
				<li><a href="index.php?mod=event&code=myevent"><span>我的活动</span></a>
				</li>
				<li><a href="index.php?mod=event&code=followevent"><span>我关注的人的活动</span></a>
				</li>
				<li><a href="index.php?mod=event&code=pevent"><span>发起活动</span></a>
				</li>
			</ul>
		</div>
		<div class="side">
			<h3>这个活动的参与者</h3>
			<div>
				<ul class="sideul sideuserList " style="overflow: hidden">
					<!--{loop $play_member $val}-->
					<li class="pane" id="follow_user_{$val[uid]}">
						<div class="fBox_l">
							<img onerror="javascript:faceError(this);" src="{$val[face]}"
								onmouseover="get_user_choose({$val[uid]},'_r_user',{$val[uid]});"
								onmouseout="clear_user_choose();" />
						</div>
						<div id="user_{$val[uid]}_r_user" class="layS"></div>
					</li>
					<!--{/loop}-->
				</ul>
			</div>
			<div>
				<a href="index.php?mod=event&code=alluser&id=$id&type=play">共{$play_count}人(查看所有参与者)</a>
			</div>
		</div>

		<div class="side">
			<h3>审核中的报名者</h3>
			<ul class="sideul sideuserList ">
				<!--{loop $app_member $val}-->
				<li class="pane" id="app_user_{$val[uid]}">
					<div class="fBox_l">
						<img onerror="javascript:faceError(this);" src="{$val[face]}"
							onmouseover="get_user_choose({$val[uid]},'_r_user',{$val[uid]});"
							onmouseout="clear_user_choose();" />
					</div>
					<div id="user_{$val[uid]}_r_user" class="layS"></div>
				</li>
				<!--{/loop}-->
				<li style="width: 280px; text-align: left"><a
					href="index.php?mod=event&code=alluser&id=$id&type=app">共{$app_count}人(查看所有审核中报名者)</a>
				</li>
			</ul>
		</div>
		<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][event][middle_right]}-->
		<!--{eval SetADV('event','middle_right');}-->
		<!--{/if}-->
	</div>
	<!--右侧--end-->
</div>

<!--{if $this->Config[ad_enable]}-->
<!--{eval SetADV('event','footer');}-->
<!--{/if}-->

<!--{template "topic_footer"}-->